package com.example.aopdemo.service;

import com.example.aopdemo.sercurity.CurrentUserHolder;
import org.springframework.stereotype.Component;

@Component
public class AuthService {
    public void checkAccess() {
        String user = CurrentUserHolder.get();
        if(!"admin".equals(user))
            throw new RuntimeException("Operation not allow");
    }
}
